home *** CD-ROM | disk | FTP | other *** search
/ PC for Alla 2005 May / PC för Alla 0505.iso / fullversioner / realsoft3d / data1.cab / Scripting / scripts / js / real / objects / r3triset.js < prev    next >
Encoding:
JavaScript  |  2005-04-04  |  7.1 KB  |  256 lines

  1.  
  2. // JavaScript wrapper for r3triset.h
  3. // Auto generated file, do not modify by hand
  4. // Copyright ⌐ 2004, Realsoft Graphics Oy
  5.  
  6. var R3_TRISET_H = 1;
  7. include("real/objects/r3level.js")
  8.  
  9.  
  10. var R3CLID_TRISET = 532;
  11.  
  12.  
  13.  
  14.  
  15. // Virtual method
  16.  
  17. R3TRISM_UPDATEFACECENTERS = 532000;
  18.  
  19. function mR3TRISM_UPDATEFACECENTERS() {
  20.   DoA(this.r3obj, 532000, 0, R3TID_INTEGER, 0);
  21. }
  22.  
  23. // Description: adds a face between three selected vertices
  24.  
  25. R3TRISM_ADDFACE = 532001;
  26.  
  27. function mR3TRISM_ADDFACE() {
  28.   DoA(this.r3obj, 532001, 0, R3TID_INTEGER, 0);
  29. }
  30.  
  31. // Description: smooths normals of selected faces or vertices
  32.  
  33. R3TRISM_SMOOTH = 532002;
  34.  
  35. function mR3TRISM_SMOOTH() {
  36.   DoA(this.r3obj, 532002, 0, R3TID_INTEGER, 0);
  37. }
  38.  
  39. // Description: flattens normals of selected faces
  40.  
  41. R3TRISM_FLATTEN = 532003;
  42.  
  43. function mR3TRISM_FLATTEN() {
  44.   DoA(this.r3obj, 532003, 0, R3TID_INTEGER, 0);
  45. }
  46.  
  47. // Description: merges selected vertices
  48.  
  49. R3TRISM_MERGE = 532004;
  50.  
  51. function mR3TRISM_MERGE() {
  52.   DoA(this.r3obj, 532004, 0, R3TID_INTEGER, 0);
  53. }
  54.  
  55. // Description: Replaces current face and point set with a new one.
  56. // p1: Integer, new face count
  57. // p2: Integer[], facecount*3 vertex indexes
  58.  
  59. R3TRISM_NEWGEOMETRY = 532005;
  60.  
  61. function mR3TRISM_NEWGEOMETRY(p1, p2) {
  62.   DoA3(this.r3obj, 532005, p1, R3TID_INTEGER, 0, p2, R3TID_INTEGER, R3TNF_ARRAY, 0, R3TID_INTEGER, 0);
  63. }
  64.  
  65. // Description: Computes smooth normals to all points. Normal side of faces may not be consistent.
  66.  
  67. R3TRISM_SMOOTHALLQUICKLY = 532006;
  68.  
  69. function mR3TRISM_SMOOTHALLQUICKLY() {
  70.   DoA(this.r3obj, 532006, 0, R3TID_INTEGER, 0);
  71. }
  72.  
  73. // Description: Set face indices
  74. // Returns: Boolean, true if succeeded
  75. // p1: Integer, index of the face
  76. // p3: Integer[], array of three indices    
  77.  
  78. R3TRISM_SETFACEINDICES = 532007;
  79.  
  80. function mR3TRISM_SETFACEINDICES(p1, p3) {
  81.   return   DoA2(this.r3obj, 532007, p1, R3TID_INTEGER, 0, p3, R3TID_INTEGER, R3TNF_ARRAY);
  82. }
  83.  
  84. // Description: Set face normals
  85. // Returns: Boolean, true if succeeded
  86. // p1: Integer, index of the face
  87. // p3: r3Vect, array of three vectors specifying normals    
  88.  
  89. R3TRISM_SETFACENORMALS = 532008;
  90.  
  91. function mR3TRISM_SETFACENORMALS(p1, p3) {
  92.   return   DoA2(this.r3obj, 532008, p1, R3TID_INTEGER, 0, p3, R3TID_VECTOR, 0);
  93. }
  94.  
  95. // Description: ask face center point
  96. // p1: Integer, index of the face
  97. // p3: r3Vect, center is stored here    
  98.  
  99. R3TRISM_GETFACECENTER = 532009;
  100.  
  101. function mR3TRISM_GETFACECENTER(p1, p3) {
  102.   DoA2(this.r3obj, 532009, p1, R3TID_INTEGER, 0, p3, R3TID_VECTOR, 0);
  103. }
  104.  
  105. // Description: ask edge center point
  106. // p1: Integer, index of the edge
  107. // p3: r3Vect, center is stored here    
  108.  
  109. R3TRISM_GETEDGECENTER = 532010;
  110.  
  111. function mR3TRISM_GETEDGECENTER(p1, p3) {
  112.   DoA2(this.r3obj, 532010, p1, R3TID_INTEGER, 0, p3, R3TID_VECTOR, 0);
  113. }
  114.  
  115. // Description: ask face normal handle points
  116. // p1: Integer, index of the face
  117. // p3: r3Vect, array of 3 vectors. Method writes handle points to it.    
  118.  
  119. R3TRISM_GETFACENORMALHANDLES = 532011;
  120.  
  121. function mR3TRISM_GETFACENORMALHANDLES(p1, p3) {
  122.   DoA2(this.r3obj, 532011, p1, R3TID_INTEGER, 0, p3, R3TID_VECTOR, 0);
  123. }
  124.  
  125. // Description: set nice normal length for all face normals
  126.  
  127. R3TRISM_SETDEFAULTNORMALLENG = 532012;
  128.  
  129. function mR3TRISM_SETDEFAULTNORMALLENG() {
  130.   DoA(this.r3obj, 532012, 0, R3TID_INTEGER, 0);
  131. }
  132.  
  133. // Description: smooths normals of selected faces or vertices if angle is greater than given limit
  134. // p3: Number, threshold angle in radians    
  135.  
  136. R3TRISM_SMOOTHBYANGLE = 532013;
  137.  
  138. function mR3TRISM_SMOOTHBYANGLE(p3) {
  139.   DoA(this.r3obj, 532013, p3, R3TID_FLOAT, 0);
  140. }
  141.  
  142. // Description: flips normal directions. In edit mode, only selected areas are flipped.
  143. // p3: Boolean, if TRUE all normals are flipped regardless of point selection state    
  144.  
  145. R3TRISM_FLIPNORMALS = 532014;
  146.  
  147. function mR3TRISM_FLIPNORMALS(p3) {
  148.   DoA(this.r3obj, 532014, p3, R3TID_BOOLEAN, 0);
  149. }
  150.  
  151.  
  152.  
  153.  
  154. R3TRISA_PointCount = 532500;
  155. function SetR3TRISA_PointCount(value) {
  156.   R3Set(this.r3obj, R3TRISA_PointCount, value, R3TID_INTEGER, 0); 
  157. }
  158.  
  159. function GetR3TRISA_PointCount() {
  160.   return R3Get(this.r3obj, R3TRISA_PointCount, R3TID_INTEGER, 0); 
  161. }
  162.  
  163. R3TRISA_Points = 532501;
  164. function SetR3TRISA_Points(value) {
  165.   R3Set(this.r3obj, R3TRISA_Points, value, R3TID_VECTOR, R3TNF_ARRAY); 
  166. }
  167.  
  168. function GetR3TRISA_Points() {
  169.   return R3Get(this.r3obj, R3TRISA_Points, R3TID_VECTOR, R3TNF_ARRAY); 
  170. }
  171.  
  172. R3TRISA_FaceCount = 532502;
  173. function SetR3TRISA_FaceCount(value) {
  174.   R3Set(this.r3obj, R3TRISA_FaceCount, value, R3TID_INTEGER, 0); 
  175. }
  176.  
  177. function GetR3TRISA_FaceCount() {
  178.   return R3Get(this.r3obj, R3TRISA_FaceCount, R3TID_INTEGER, 0); 
  179. }
  180.  
  181. var R3TRISA_Type = 532504; // Integer
  182. R3TRISA_SelectResolution = 532505;
  183. function SetR3TRISA_SelectResolution(value) {
  184.   R3Set(this.r3obj, R3TRISA_SelectResolution, value, R3TID_INTEGER, 0); 
  185. }
  186.  
  187. function GetR3TRISA_SelectResolution() {
  188.   return R3Get(this.r3obj, R3TRISA_SelectResolution, R3TID_INTEGER, 0); 
  189. }
  190.  
  191. R3TRISA_PointsNotAnimateable = 532512;
  192. function SetR3TRISA_PointsNotAnimateable(value) {
  193.   R3Set(this.r3obj, R3TRISA_PointsNotAnimateable, value, R3TID_INTEGER, 0); 
  194. }
  195.  
  196. function GetR3TRISA_PointsNotAnimateable() {
  197.   return R3Get(this.r3obj, R3TRISA_PointsNotAnimateable, R3TID_INTEGER, 0); 
  198. }
  199.  
  200. R3TRISA_PhongCorrection = 532513;
  201. function SetR3TRISA_PhongCorrection(value) {
  202.   R3Set(this.r3obj, R3TRISA_PhongCorrection, value, R3TID_FLOAT, 0); 
  203. }
  204.  
  205. function GetR3TRISA_PhongCorrection() {
  206.   return R3Get(this.r3obj, R3TRISA_PhongCorrection, R3TID_FLOAT, 0); 
  207. }
  208.  
  209. var R3TRIHT_VERTEX = 1;
  210. var R3TRIHT_EDGE = 2;
  211. var R3TRIHT_FACE = 3;
  212. var R3TRIHT_NORMAL = 4;
  213. var R3TRISR_POINT = 0;
  214. var R3TRISR_EDGE = 1;
  215. var R3TRISR_FACE = 2;
  216.  
  217.  
  218. function r3Triset () { 
  219.    this.base = r3God;
  220.    if(arguments.length) {
  221.       this.base(R3CLID_TRISET, arguments);
  222.    }
  223.    // Methods
  224.    this.UPDATEFACECENTERS=mR3TRISM_UPDATEFACECENTERS;
  225.    this.ADDFACE=mR3TRISM_ADDFACE;
  226.    this.SMOOTH=mR3TRISM_SMOOTH;
  227.    this.FLATTEN=mR3TRISM_FLATTEN;
  228.    this.MERGE=mR3TRISM_MERGE;
  229.    this.NEWGEOMETRY=mR3TRISM_NEWGEOMETRY;
  230.    this.SMOOTHALLQUICKLY=mR3TRISM_SMOOTHALLQUICKLY;
  231.    this.SETFACEINDICES=mR3TRISM_SETFACEINDICES;
  232.    this.SETFACENORMALS=mR3TRISM_SETFACENORMALS;
  233.    this.GETFACECENTER=mR3TRISM_GETFACECENTER;
  234.    this.GETEDGECENTER=mR3TRISM_GETEDGECENTER;
  235.    this.GETFACENORMALHANDLES=mR3TRISM_GETFACENORMALHANDLES;
  236.    this.SETDEFAULTNORMALLENG=mR3TRISM_SETDEFAULTNORMALLENG;
  237.    this.SMOOTHBYANGLE=mR3TRISM_SMOOTHBYANGLE;
  238.    this.FLIPNORMALS=mR3TRISM_FLIPNORMALS;
  239.  
  240.    // Attributes
  241.    this.GetPointCount=GetR3TRISA_PointCount;
  242.    this.SetPointCount=SetR3TRISA_PointCount;
  243.    this.GetPoints=GetR3TRISA_Points;
  244.    this.SetPoints=SetR3TRISA_Points;
  245.    this.GetFaceCount=GetR3TRISA_FaceCount;
  246.    this.SetFaceCount=SetR3TRISA_FaceCount;
  247.    this.GetSelectResolution=GetR3TRISA_SelectResolution;
  248.    this.SetSelectResolution=SetR3TRISA_SelectResolution;
  249.    this.GetPointsNotAnimateable=GetR3TRISA_PointsNotAnimateable;
  250.    this.SetPointsNotAnimateable=SetR3TRISA_PointsNotAnimateable;
  251.    this.GetPhongCorrection=GetR3TRISA_PhongCorrection;
  252.    this.SetPhongCorrection=SetR3TRISA_PhongCorrection;
  253. }
  254.  
  255. r3Triset.prototype=new r3Level;
  256. // r3triset.h_H